package com.example.weiji_1;

import java.util.ArrayList;

import wordroid.model.Massage;

import com.example.weiji_1.datebase.DataAccess;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

public class Part2 extends Activity {

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.part2);
		Button bt1 = (Button)findViewById(R.id.button1);
		
		TextView view = (TextView)findViewById(R.id.textView2);
		DataAccess data = new DataAccess(this);
		final ArrayList<Massage> massageList = data.QueryMsg(null, null); 
        view.setText(massageList.get(1).getMessage()); 
		bt1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(Part2.this, Study2.class);
				Part2.this.startActivity(intent);
				
			}
		});
		
}

}
